var express = require('express');
var router = express.Router();

/* GET login page. */
router.get('/', function(req, res, next) {
  // 处理一些业务并返回下面数据
  var name = 'admin';
  var pwd = '123456';
  //res.cookie('username', req.query.username);
  var password = req.query.password;
  if(name == req.query.username && pwd == password){
    res.json({username:req.query.username});
  } else{
    res.status(500).send({error:"用户名或密码错误！"});
  }
  // res.json({name:name});
});

module.exports = router;
